package com.ruibang.glass.purchase.constant;

/**
 * @author 宋锦康
 */
public enum PurchaseErrorCode {
    INSERT_ERROR(100030018, "新增数据不成功"),
    UPDATE_ERROR(100030019, "修改数据不成功"),
    DELETE_ERROR(100030020, "删除数据不成功"),
    SELECT_ERROR(100030021, "查询数据不成功"),
    SEND_NOTE_IS_FAILED(100030022, "发送报警短信失败!"),
    PUSH_USER_INFO_IS_NULL(100030023, "最少需要配置一个推送用户"),
    QUERY_TARGET_IS_NULL(100030024, "查询目标为空"),
    BUSINESS_MENU_IS_EMPTY(100040011, "业务菜单ID不能为空"),
    MONITOR_DATA_EXPORT_FAIL(100030025, "数据导出失败！"),
    BAD_GOOD_NO_ALL(1000030020,"质检良品等和不良品数总和不等于到货数量！请检查数量"),
    NOT_REMOVE_APPLY_NAME(1000030021,"层级有子层级！暂时无法删除"),
    NOT_NO_PRODUCT(1000030022,"新增暂无物料 ！请检查物料是否勾选"),
    NOT_NO_OR_NULL(1000030023,"新增暂无物料 请检查数量和金额"),
    NOT_NO_UNION_APPROVE(1000030024,"上传签章的合同暂时未关联审批单 请稍后再试"),
    NOT_NO_UPDATE_QZ(1000030025,"审批流程暂未结束 暂时无法上传签章"),
    ONLY_ORDER_USING(1000030026,"只有采购订单可以再次生成采购订单"),
    NOT_APPROVE_NO_ENDING(1000030027,"此流程暂未结束请稍后再试"),
    ARRIVAL_NO_PRODUCT(1000030028,"采购到货 暂无商品"),
    NO_AMOUNT(1000030029,"中标金额为空！请输入0 或者其他数"),
    NOT_SUPPLIER_PRODUCT(1000030030,"供应商列表不能为空!"),
    NOT_FIND_MATERIAL_CODE(1000030031,"找不到对应仓库，请检查!"),
    PROJECT_NUMBER_IS_NOT_NULL(1000030032,"项目编号不能为空，请检查!"),
    SELECT_PROJECT_IS_USED(1000030033,"选择项目已被使用，请检查!"),
    PURCHASE_APPLICATION_IS_NULL(1000030034,"发起流程失败[申请人信息为空]!"),
    ARRIVAL_ORDER_ITEM_IS_EMPTY(1000030035,"到货单物品信息不能为空，请检查!"),
    RETURN_ORDER_ITEM_IS_EMPTY(1000030099,"退货单物品信息不能为空，请检查!"),
    RETURN_NO_PC_ITEM_IS_EMPTY(1000030100,"退货单原材料!批次信息不能为空!请检查!"),
    RETURN_NO_BARCODE_ITEM_IS_EMPTY(1000030101,"退货单原材料!条形码信息不能为空!请检查!"),
    IN_INVENTORY_PROCESS_IS_START(1000030036,"入库流程已发起或未取消，不能修改质检结果!"),
    QUALITY_IS_MORE_THAN_REQUEST(1000030037,"数量大于申请数量"),
    QUALITY_IS_MORE_ALL_REQUEST(1000030038,"退货数量大于入库数量！ 请检查数量"),
    NO_RETURN_PRODUCTS(1000030055,"退货物品为空！请检查物品"),
    NO_RETURN_PRODUCTS_NO_QUALITY(1000030056,"退货数量为空！请检查数量"),
    ITEM_ANALYSIS_FAIL(1000030019,"物品解析失败，请检查EXCEL写入数据是否正确（例如：数量不可填写中文）！"),
    DOWNLOAD_TEMPLATE_FAIL(1000030040,"模板下载失败，请联系管理员！"),
    CANNOT_HAVE_SAME_ITEM(1000030041,"不可上传相同物品信息！"),

    PURCHASE_REPORT_IS_EXIST(1000030042,"当前评标已存在,请确认!");
    private int code;
    private String msg;

    PurchaseErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }

    public static String getValue(int code) {
        for (PurchaseErrorCode ele : values()) {
            if (ele.getCode() == code) {
                return ele.getMsg();
            }
        }
        return null;
    }
}
